package service;

import org.apache.thrift.TProcessor;
import org.apache.thrift.protocol.TBinaryProtocol;
import org.apache.thrift.server.TServer;
import org.apache.thrift.server.TSimpleServer;
import org.apache.thrift.transport.TServerSocket;
import org.apache.thrift.transport.TTransportException;
import thrift.Hello;
import thrift.HelloServiceImpl;

public class HelloServiceServer {

    public static void main(String[] args) throws TTransportException {
        TProcessor tProcessor = new Hello.Processor<Hello.Iface>(new HelloServiceImpl());
        TServerSocket tServerSocket = new TServerSocket(9898);
        TServer.Args tArgs = new TServer.Args(tServerSocket);
        tArgs.processor(tProcessor);
        tArgs.protocolFactory(new TBinaryProtocol.Factory());
        TServer server = new TSimpleServer(tArgs);
        server.serve();
    }
}
